package greetings

import (
	"fmt"
	"io/ioutil"
)

func ReadAndWriteFile() {

	filename := "/tmp/123.txt"
	body, _ := ioutil.ReadFile(filename)
	fmt.Println("read file:", filename, "content is :", string(body))

	ioutil.WriteFile(filename, []byte("这是一段测试写文件内容的代码"), 0600)

	body, _ = ioutil.ReadFile(filename)
	fmt.Println("read file:", filename, "content is :", string(body))
}
